import config from '@/config'
import themeColor from './themeColor'
// import '@/theme/cartoon.scss';
// import '@/theme/technological.scss';
export const themeMap = {
	cartoon: 'cartoon',
	technological: 'technological'
}

class themeFactory {
	constructor() {
	    this.thatTheme = config.theme || ''
		this.initTheme()
	}
	getThatThemeClass(){
		return themeMap[this.thatTheme]
	}
	initTheme(){
		 this.initBarColor()
	}
	initBarColor(){
		const barObj = themeColor[this.thatTheme]
		const navBar = barObj.navBar
		const tabBar = barObj.tabBar
		
		uni.setNavigationBarColor(navBar);
		// 设置tabbar
		uni.setTabBarStyle(tabBar); 
	}
}


export default new themeFactory()


